<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:icecore="http://www.icefaces.org/icefaces/core"
	xmlns:ice="http://www.icesoft.com/icefaces/component"
	xmlns:ace="http://www.icefaces.org/icefaces/components">
<h:head>
	<title>inBOtta</title>
	<ice:outputStyle href="../css/woodstock/woodstock.css" rel="stylesheet" type="text/css" />
</h:head>
<h:body>
	<h:form id="insEvento" >

		<ice:outputText value="#{messaggioBean.messaggio}" />

		<ace:pushButton value="Annulla Inserimento" immediate="true" action="gestione"/>

		<ice:portlet>
			<ice:panelGrid columns="2">
				<ice:outputLabel for="tit" value="Titolo"></ice:outputLabel>
				<ice:inputText id="tit"  value="#{gestioneBean.ev.titolo}" />
				<ice:outputLabel for="categoria" value="Categoria" ></ice:outputLabel>
				<ice:inputText id="categoria"  value="#{gestioneBean.ev.categoria}"  />
				<ice:outputLabel for="key" value="Keywords" ></ice:outputLabel>
				<ice:inputText id="key"  value="#{gestioneBean.ev.keywords}"  />
				<ice:outputLabel for="selTip" value="Tipo"></ice:outputLabel>
				<ice:selectOneMenu value="#{gestioneBean.ev.tipo}"
				valueChangeListener="#{gestioneBean.onChangeTipoEvento}" id="selTip"
				partialSubmit="true">
				<f:selectItems id="tipi" value="#{gestioneBean.tipiEventi}" />
			    </ice:selectOneMenu>
				<ice:outputLabel for="indirizzo" value="indirizzo"></ice:outputLabel>
				<ice:inputText id="indirizzo"  value="#{gestioneBean.ev.indirizzo}" />
				<ice:outputLabel for="hp" value="home page"></ice:outputLabel>
				<ice:selectBooleanCheckbox id="hp"  value="#{gestioneBean.ev.hp}" />
				<ice:outputLabel for="nomeLuogo" value="Nome Luogo"></ice:outputLabel>
				
                <ice:selectInputText id="nomeLuogo"
                                     options="{frequency:0.5}"                                     
                                     partialSubmit="true"
                                     value="#{gestioneBean.selectedText}"
                                     textChangeListener="#{gestioneBean.luogoChanged}"
                                     actionListener="#{gestioneBean.submitLuogo}"
                                     rows="10" width="300">
                     				<f:selectItems value="#{gestioneBean.availableLuoghi}"/>
                </ice:selectInputText>                     
				<ice:outputLabel for="descBreve" value="Descrizione Breve"></ice:outputLabel>
				<ice:inputText id="descBreve"  value="#{gestioneBean.ev.descrizioneBreve}" />
				<ice:outputLabel for="descrizione" value="Descrizione"></ice:outputLabel>
				<ice:inputTextarea id="descrizione"  value="#{gestioneBean.ev.descrizione}" />				
				<ice:outputLabel for="prezzo" value="Prezzo"></ice:outputLabel>
				<ice:inputText id="prezzo"  value="#{gestioneBean.ev.prezzo}" />
				<ice:outputLabel for="set" value="Settimanale"></ice:outputLabel>				
				<ice:selectBooleanCheckbox id="set"  value="#{gestioneBean.ev.settimanale}" partialSubmit="true"  immediate="true" />				
				<ice:outputLabel for="tes" value="Tessera"></ice:outputLabel>				
				<ice:selectBooleanCheckbox id="tes"  value="#{gestioneBean.ev.tessera}" partialSubmit="true"  immediate="true" />
				<ice:outputLabel for="web" value="Indirizzo Web"></ice:outputLabel>
				<ice:inputText id="web"  value="#{gestioneBean.ev.web}" />				
				<ice:outputLabel for="giorno" value="Giorno se evento ogni settimana" rendered="#{gestioneBean.ev.settimanale}"  />
				<ice:selectOneMenu value="#{gestioneBean.ev.giorno}" rendered="#{gestioneBean.ev.settimanale}"
				valueChangeListener="#{gestioneBean.onChangeGiornoEvento}" required="#{gestioneBean.ev.settimanale}" id="giorno"
				partialSubmit="true">
				<f:selectItem itemLabel="Domenica" itemValue="1" />
				<f:selectItem itemLabel="Lunedi" itemValue="2" />
				<f:selectItem itemLabel="Martedi" itemValue="3" />
				<f:selectItem itemLabel="Mercoledi" itemValue="4" />
				<f:selectItem itemLabel="Giovedi" itemValue="5" />
				<f:selectItem itemLabel="Venerdi" itemValue="6" />
				<f:selectItem itemLabel="Sabato" itemValue="7" />
			    </ice:selectOneMenu>				
			    <ice:outputLabel for="data" value="Data Inizio" rendered="#{!gestioneBean.ev.settimanale}"  />
				<ice:selectInputDate 	rendered="#{!gestioneBean.ev.settimanale}" required="#{!gestioneBean.ev.settimanale}"
					id="data" value="#{gestioneBean.ev.data}"  >
					<f:convertDateTime pattern="#{gestioneBean.DATE_PATTERN}" />
				</ice:selectInputDate>
				<ice:outputLabel for="dataFine" value="Data Fine" rendered="#{!gestioneBean.ev.settimanale}" />
				<ice:selectInputDate 	
					id="dataFine" value="#{gestioneBean.ev.dataFine}" rendered="#{!gestioneBean.ev.settimanale}" required="#{!gestioneBean.ev.settimanale}" >
					<f:convertDateTime pattern="#{gestioneBean.DATE_PATTERN}" />
				</ice:selectInputDate>
			    <ice:outputLabel for="ora" value="Ora" rendered="#{gestioneBean.ev.settimanale}"   />
				<ace:dateTimeEntry 	timeOnly="true" pattern="#{gestioneBean.HOUR_PATTERN}" 
					id="ora" value="#{gestioneBean.ev.ora}" rendered="#{gestioneBean.ev.settimanale}" required="#{gestioneBean.ev.settimanale}" >
				</ace:dateTimeEntry>
				<ice:outputLabel for="foto" value="Foto"/>
				
				<ace:fileEntry id="foto" useOriginalFilename="true" useSessionSubdir="false" relativePath="images/eventi" results="#{gestioneBean.fotoEv}">
				</ace:fileEntry>
				<h:commandButton type="submit" value="Inserisci Evento" action="#{gestioneBean.doInsEvento}"></h:commandButton>
			</ice:panelGrid>
		</ice:portlet>
		
		
		
	</h:form>
</h:body>
</html>
